package com.gmail.mariska.martin.jpa;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.persistence.PostLoad;
import javax.persistence.PostPersist;
import javax.persistence.PostRemove;
import javax.persistence.PostUpdate;
import javax.persistence.PrePersist;
import javax.persistence.PreRemove;
import javax.persistence.PreUpdate;

import org.apache.log4j.Logger;

public class EntityListener {
	static final Logger logger = Logger.getLogger(EntityListener.class);

	@PrePersist
	public void onPrePersist(Object o) {
		logger.debug("onPrePersist:" + o);
	}

	@PreDestroy
	public void onPreDestroy(Object o) {
		logger.debug("onPreDestroy:" + o);
	}

	@PreRemove
	public void onPreRemove(Object o) {
		logger.debug("onPreRemove:" + o);
	}

	@PreUpdate
	public void onPreUpdate(Object o) {
		logger.debug("onPreUpdate:" + o);
	}

	@PostPersist
	public void onPostPersist(Object o) {
		logger.debug("onPostPersist:" + o);
	}

	@PostUpdate
	public void onPostUpdate(Object o) {
		logger.debug("onPostUpdate:" + o);
	}

	@PostConstruct
	public void onPostConstruct(Object o) {
		logger.debug("onPostConstruct:" + o);
	}

	@PostLoad
	public void onPostLoad(Object o) {
		logger.debug("onPostLoad:" + o);
	}

	@PostRemove
	public void onPostRemove(Object o) {
		logger.debug("onPostRemove:" + o);
	}
}
